Various classes of block diagram models describe computations that can be performed on application-specific computing hardware, such as a computer, microcontroller, FPGA, and custom hardware. Classes of such block diagram models may include time-based block diagrams such as those found within Simulink® from The MathWorks, Inc. of Natick, Mass., state-based and flow diagrams such as those found within Stateflow® from The MathWorks, Inc. of Natick, Mass., entity flow networks such as those found within SimEvents from The MathWorks, Inc. of Natick, Mass., and data-flow diagrams. A common characteristic among these various forms of block diagrams is that they define semantics on how to execute the diagram.
Historically, engineers and scientists have utilized time-based block diagram models in numerous scientific areas such as Feedback Control Theory and Signal Processing to study, design, debug, and refine dynamic systems. Dynamic systems, which are characterized by the fact that their behaviors change over time, are representative of many real-world systems. Time-based block diagram modeling has become particularly attractive over the last few years with the advent of software packages such as Simulink® from The MathWorks, Inc. Such packages provide sophisticated software platforms with a rich suite of support tools that makes the analysis and design of dynamic systems efficient, methodical, and cost-effective.
The block diagrams are not exclusively used for representing time-based dynamic systems but also for other models of computation. For instance, flow-charts are block diagrams used to capture process flow and are not generally suitable for describing dynamic system behavior. Data flow block diagrams are block diagrams that describe a graphical programming paradigm where the availability of data (often thought of as tokens) is used to initiate the execution of blocks, where a block represents an operation and a line represents execution dependency describing the direction of data flowing between blocks.
Conventional simulation models become more complex as models are developed that model more complex systems. Hundreds of thousands of blocks that represent primitive and aggregate mathematical operations may be present. To manage the complexity of such models, principles of partitioning, abstraction, and hierarchy are applied. Hierarchy in graphical models is typically captured by subsystems. The subsystems are modeled by primitive blocks and/or additional subsystems. Because subsystems may contain subsystems, a mechanism exists for hierarchically structuring a model.
In a large block diagram model on which a plurality of teams work at the same time, each team may develop modeling constructs independently of other teams and incorporate the constructs into the model. Sometimes, the block diagram model may include duplicated portions of the same or similar pattern incorporated by different teams. The existence of duplicated portions of the same or similar pattern in the block diagram model can reduce the efficiency of the block diagram model. For example, it may reduce simulation performance because the block diagram requires memory space for each of the duplicated portions and hence decreases simulation speed. It may also reduce the embedded system performance because the generated code for the block diagram includes duplicated portions of the same or similar code. Therefore, it is desired to identify duplicated portions of the same or similar pattern in a block diagram model and replace the duplicated portions with a sub-model, or a subsystem, that can be shared for the duplicated portions.
In addition, the project performed by multiple teams may have a design standard or style that should be complied with by each team for project success and teamwork and achieving system integration. For example, Mathworks Automotive Advisory Board (MAAB) guidelines provide guidelines for the patterns of a Simulink® model. In the conventional block diagram environment, it is difficult and time-consuming to check whether a block diagram model complies with the design standard or style. Therefore, it is desired to automatically check whether the patterns of a block diagram model comply with a design standard or style.